#!/usr/bin/perl -w
package UCSChooks;
use strict;

our $VERSION = '1.00';
use base 'Exporter';
our @EXPORT = qw();

sub make_excel_link {
  shift @_;
  my $species = shift @_;
  my $chromosome = shift @_;
  my $start = shift @_;
  my $finish = shift @_;
  my $hiturl = UCSChooks->make_url($species,$chromosome,$start,$finish);
  $hiturl = "=hyperlink(\"$hiturl\",\"<$species>$chromosome:$start-$finish\")";
  return $hiturl;
}  

sub make_url {
  shift @_;
  my $species = shift @_;
  my $chromosome = shift @_;
  my $start = shift @_;
  my $finish = shift @_;
  my $hiturl = '';
  if($species eq 'danrer4') {
    $hiturl = 'http://genome.ucsc.edu/cgi-bin/hgTracks?hgsid=172107814&clade=vertebrate&org=Zebrafish&db=danRer4&position=' . $chromosome . ':' . $start . '-' . $finish;
  }
  if($species eq 'hg18') {
    $hiturl = 'http://genome.ucsc.edu/cgi-bin/hgTracks?hgsid=172107814&clade=mammal&org=Human&db=hg18&position=' . $chromosome . ':' . $start . '-' . $finish;
  }
  if($species eq 'mm9') {
    $hiturl = 'http://genome.ucsc.edu/cgi-bin/hgTracks?hgsid=172107814&clade=mammal&org=Mouse&db=mm9&position=' . $chromosome . ':' . $start . '-' . $finish;
  }
  if($species eq 'fr2') {
    $hiturl = 'http://genome.ucsc.edu/cgi-bin/hgTracks?hgsid=172107814&clade=vertebrate&org=Fugu&db=fr2&position=' . $chromosome . ':' . $start . '-' . $finish;
  }
  return $hiturl;
}


sub new {}

1;
